package value

type Response struct {
	Code    int         `json:"code"`
	Message string      `json:"message"`
	Data    interface{} `json:"data,omitempty"`
}

func Forbidden() *Response {
	return &Response{
		Code:    403,
		Message: "not has permission",
	}
}

func Success(data interface{}) *Response {
	return &Response{
		Code: 0,
		Data: data,
	}
}

func Fail(errorCode int, message string) *Response {
	return &Response{
		Code:    errorCode,
		Message: message,
	}
}
